﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApp1.Model;

namespace WpfApp1.ViewModel
{
    public  class MainViewModel
    {
        //public Person person = new Person();

        //必须是属性绑定属性
        //数据源的属性绑定到控件属性
        //public Person person;
        public Person person { get; set; }
        public ObservableCollection<Person> Persons { get; set; } = new ObservableCollection<Person>();
        public MainViewModel()
        {
            person = new Person();
            person.name = "xxxxx";
            person.age = 18;
            person.money = 10;
            person.address = "苏州市";
            Persons.Add(person);

        }

        

    }
}
